﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Solution"
    elementFormDefault="qualified" attributeFormDefault="qualified"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:include schemaLocation="Area.xsd"/>
  <xs:include schemaLocation="Scene.xsd"/>
  <xs:element name="Solution" type="SolutionType">
    <xs:key name="SolutionNameKey">
      <xs:selector xpath=".
                   |.//Solution
                   |.//Scene
                   |.//SceneRef
                   |.//Area
                   |.//Part"/>
      <xs:field xpath="@Name"/>
    </xs:key>
  </xs:element>
  <xs:complexType name="SolutionType">
    <xs:all>
      <xs:element name="Property-List" type="Property-ListType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="Scene-List" type="Scene-ListType"  minOccurs="0" maxOccurs="1"/>
      <xs:element name="Displayflow" type="DisplayflowType"  minOccurs="0" maxOccurs="1"/>
    </xs:all>
    <xs:attribute name="Name" type="NameType" use="required"/>
    <xs:attribute name="Caption" type="xs:string"/>
    <xs:attribute name="Version" type="xs:string" use="required"/>
    <xs:attribute name="RuntimeVersion" type="xs:string"/>
    <xs:attribute name="Type" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="APP"/>
          <xs:enumeration value="SHOW"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="DisplayflowType">
    <xs:choice maxOccurs="unbounded">
      <xs:element name="DisplayflowNode" type="DisplayflowNodeType"/>
    </xs:choice>
    <xs:attribute name="BeginNode" type="xs:string" use="required"/>
    <xs:attribute name="IsRepeat" type="xs:boolean"/>
    <xs:attribute name="SwitchInterval" type="xs:integer"/>
  </xs:complexType>
  <xs:complexType name="DisplayflowNodeType">
    <xs:all>
      <xs:element name="Parameter-List" type="Parameter-ListType"/>
    </xs:all>
    <xs:attribute name="Name" type="xs:string" use="required"/>
    <xs:attribute name="Caption" type="xs:string"/>
    <xs:attribute name="SceneName" type="xs:string" use="required"/>
    <xs:attribute name="NextName" type="xs:string" use="required"/>
  </xs:complexType>
</xs:schema>
